import request from '@/utils/request'

// 查询入库单列表
export function listReceipt(query) {
  return request({
    url: '/wms/receipt/list',
    method: 'get',
    params: query
  })
}

// 查询入库单详细
export function getReceipt(receiptId) {
  return request({
    url: '/wms/receipt/' + receiptId,
    method: 'get'
  })
}

// 新增入库单
export function addReceipt(data) {
  return request({
    url: '/wms/receipt',
    method: 'post',
    data: data
  })
}

// 修改入库单
export function updateReceipt(data) {
  return request({
    url: '/wms/receipt',
    method: 'put',
    data: data
  })
}

// 删除入库单
export function delReceipt(receiptId) {
  return request({
    url: '/wms/receipt/' + receiptId,
    method: 'delete'
  })
}

// 导出入库单
export function exportReceipt(query) {
  return request({
    url: '/wms/receipt/export',
    method: 'get',
    params: query
  })
}

// 审核入库单
export function auditReceipt(data) {
  return request({
    url: '/wms/receipt/audit',
    method: 'put',
    data: data
  })
}

// 获取入库单明细
export function getReceiptDetails(receiptId) {
  return request({
    url: '/wms/receipt/details/' + receiptId,
    method: 'get'
  })
}

// 执行入库操作
export function executeReceipt(receiptId, details) {
  return request({
    url: '/wms/receipt/execute/' + receiptId,
    method: 'post',
    data: details
  })
}